<% obj_id = "#{id}-#{rand(1_000)}" %>
<iframe
  class="tweet-embed"
  scrolling="no"
  id="tweet-<%= obj_id %>"
  src="https://platform.twitter.com/embed/Tweet.html?id=<%= id %>">
</iframe>
<script>
  // Detect dark theme
  var iframe = document.getElementById('tweet-<%= obj_id %>');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=<%= id %>&theme=dark"
  }

</script>

